package com.shop.dingdongshoppingapi.controller;

import com.shop.dingdongshoppingapi.dto.AdressEditDto;
import com.shop.dingdongshoppingapi.entity.AdressEdit;
import com.shop.dingdongshoppingapi.service.intf.AdressEditService;
import com.shop.dingdongshoppingapi.service.intf.UserService;
import com.shop.dingdongshoppingapi.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/adress/")
@Api("地址编辑接口")
@CrossOrigin
public class AdressEidtController {
    @Resource
    private AdressEditService service;

    @PostMapping("addadress.do")
    @ApiOperation("地址添加功能")
    public R addAdress(@RequestBody AdressEditDto add){
        return service.addAdress(add);
    }

    @PostMapping("deleteadress.do")
    @ApiOperation("删除功能")
    public R deleteAdress( int id){
        return service.deleteid(id);
    }

    @GetMapping("selectall.do")
    @ApiOperation("查询功能")
    public R selectAllAdress(int id){

        return service.selectAllAdress(id);
    }
}
